package org.openlaszlo.generator;


public class GenerateBaseXSD extends GenerateSchema {
	
	public static void main(String... args) {
		
		if (args.length == 0) {
			
			GenerateBaseXSD generateBaseXSD = new GenerateBaseXSD();
			
			generateBaseXSD.getXsdUtil().setNameSpace("http://localhost/openlaszlo/lzx");
			generateBaseXSD.getXsdUtil().setXsdProjectPrefix("lzx");
			
			generateBaseXSD.scanFolder("openlaszlo/lps/");
			generateBaseXSD.scanFolder("test/core/lfc/");
			
			generateBaseXSD.printXsd("WebContent/lzx.xsd","test/core/static_simpleTypes.txt");
			
		} else if (args.length == 4) {
			
			String lzxNameSpace = args[0];
			String lzxPrefix = args[1];
			String lzxXsdFileName = args[2];
			
			String lzxBaseComponentsPath = args[3];
			
			GenerateBaseXSD generateBaseXSD = new GenerateBaseXSD();
			
			generateBaseXSD.getXsdUtil().setNameSpace(lzxNameSpace);
			generateBaseXSD.getXsdUtil().setXsdProjectPrefix(lzxPrefix);
			
			generateBaseXSD.scanFolder(lzxBaseComponentsPath);
			generateBaseXSD.scanFolder("static/lfc/");
			
			generateBaseXSD.printXsd(lzxXsdFileName,"static/static_simpleTypes.txt");
			
		} else {
			
			System.err.println("Wrong number of arguments! 4 or 0 required");
			
		}
	}
	
}
